<script>
	$(function(){
		layui.use('common', function(){
			var common = layui.common;

			// 获取分页数据
			common.ajaxPage({
				url  : "<{:U('General/select')}>",
				target: $("#layui-page"),
				container: $("#ajax_content"),
				template: $("#layui-tpl"),
				before: function(){
					var data = {};
					<if condition="$brand_id neq 0">
						// 树形菜单提交
						data = {brand_id: <{$brand_id}>}
					<else/>
						// 下拉列表提交
						$.each($("form.sideSearchContainer").serializeArray(), function () {
							data[this.name] = this.value;
						});
					</if>
					return data;
				}
			})

			$("div.content").delegate("a[name='sel_vehicle']",'click', function(event) {
				$("form.sideSearchContainer input[name='aid']").val($(this).attr("aid"));
				$("form.sideSearchContainer").submit();
			})
		});
	})
</script>

<!-- 当前位置 -->
<div class="breadCrumbs"><i class="icon icon-home"></i><a href="#"><{$module}></a></div>
<!-- 搜索结果 -->
<div class="container" id="ajax_content"></div>
<!-- 分页 -->
<div id="layui-page"></div>

<!-- 数据模板 -->
<script id="layui-tpl" type="text/html">
	<div class="selected_title">
		<p class="num">A tatle of <span>{{d.count ? d.count : 0}}</span> models</p>
		<div class="clearfix"></div>
	</div>
	{{#  if(d.lists == "none"){ }}
	    <blockquote class="layui-elem-quote layui-quote-nm">Nothing is found...</blockquote>
    {{# } else { }}
    	<div class="selected_container" style="display:block">
	    <div class="row">
		    {{# for(var i=0;i<d.lists.length;i++){ var vo=d.lists[i] }}
		        <div class="col-4">
		        	<div>
						<a href="#" aid="{{vo.id}}" name="sel_vehicle"><img src="{{vo.url}}" alt=""></a>
		        	</div>
					<p><a href="#">{{vo.brand}}</a></p>
					<p class="desc"><a href="#">gallery<span>(123)</span></a>| <a href="#" aid="{{vo.id}}" name="sel_vehicle">Basic parameters </a></p>
				</div>
		    {{# }; }}
	    </div>
	    </div>
	{{# }; }}  
</script>

